import time

from src.mouse_key import *


def sell():
    # 打开商店
    shop_btn = "images/shop_btn.png"
    locate_click(shop_btn)
    # 点击贩卖
    # sell_btn = "images/sell_btn.png"
    sell_btn = (282,498)
    point_screen(*sell_btn)
    click()
    # locate_click(sell_btn)
    # 出售
    sell_close = "images/sell_close.png"
    point_screen(285, 317)
    click("right")
    locate_click(sell_close)
    # 退出
    # quit_btn = "images/quit_btn.png"
    quit_btn = (392,582)
    point_screen(*quit_btn)
    click()
    # locate_click(quit_btn)


def main():
    while True:
        try:
            point_screen(300, 300)
            time.sleep(1)
            sell()
            count_down(30)
        except Exception as e:
            print("报错")
            print(e)


if __name__ == "__main__":
    main()
